Path: api/v1/stock/{stockno}/prices
This API is JSON:API compliant.
This endpoint supports the following methods:
GET
This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.
The resource type for this endpoint is StockPrices
The identifier is stockNo-stockPriceId
Attributes
The StockPrices resource type attributes are as follows:
| Attribute | Type | Description |
|---|---|---|
| basePriceLevel | string | The base price level this price is derived from. |
| branchCode | string | The branch code. Branches are optional in Jim2 - this is only set when your site is configured to use branches. Note: Will not be returned in the response if value is null. |
| branchNo | integer | The internal branch number used to identify the branch. Branches are optional in Jim2 - this is only set when your site is configured to use branches. Note: Will not be returned in the response if value is null. |
| currencyCode | string | The currency code for the price. |
| discountPerc | number | The discount percentage applied to the base price. |
| priceBreaks | array of object | Quantity price breaks for this price level. See the priceBreaks section below. |
| priceCalcMethod | string | How the price is calculated (e.g. Fixed Price, Last COGS + Markup, List - Discount). |
| priceExcl | number | The price excluding tax. |
| priceIncl | number | The price including tax. |
| priceLevel | string | The price level (label, prefixed with the level number for custom levels). |
| stockPriceId | integer | The internal price id used to identify the price. |
| taxCode | string | The tax code for the price. |
Attributes of each element in the priceBreaks array.
| Attribute | Type | Description |
|---|---|---|
| discountPerc | number | The discount percentage at this price break. |
| priceExcl | number | The price excluding tax at this price break. |
| priceIncl | number | The price including tax at this price break. |
| qtyGreaterOrEqual | number | The minimum quantity (>=) at which this price break applies. |
Path: api/v1/stock/10/prices Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response. This is a list. To keep the example readable, only the first item below is written out; the later items have been trimmed down in this documentation. In a real response each item comes back with the data applicable to that record (as described above). Side-loading related resources with the include query parameter is not supported on list endpoints: an include parameter is ignored here and no included section is returned. To retrieve a related resource, request it directly using the id shown in each item's relationships, or use the single-resource (get by id) endpoint, which does support include.
Example GET (Return all)
{
"data": [
{
"id": "10-123",
"type": "StockPrices",
"attributes": {
"stockPriceId": 123,
"priceLevel": "1-Retail",
"priceCalcMethod": "List - Percent",
"basePriceLevel": "",
"currencyCode": "AUD",
"taxCode": "G",
"branchNo": 1,
"branchCode": "ACT",
"discountPerc": 0.0,
"priceExcl": 44.37,
"priceIncl": 48.807,
"priceBreaks": [
{
"qtyGreaterOrEqual": 10.0,
"discountPerc": 5.0,
"priceExcl": 42.15,
"priceIncl": 46.365
},
{
"qtyGreaterOrEqual": 50.0,
"discountPerc": 10.0,
"priceExcl": 39.93,
"priceIncl": 43.923
},
{
"qtyGreaterOrEqual": 100.0,
"discountPerc": 15.0,
"priceExcl": 37.71,
"priceIncl": 41.481
}
]
}
},
{
"id": "10-129",
"type": "StockPrices",
"attributes": {
"priceLevel": "3-Do & Charge",
"priceExcl": 44.37
}
}
]
}
Path: api/v1/stock/10/prices/10-129 Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example GET (Return specific)
{
"data": {
"id": "10-129",
"type": "StockPrices",
"attributes": {
"stockPriceId": 129,
"priceLevel": "3-Do & Charge",
"priceCalcMethod": "List - Percent",
"basePriceLevel": "",
"currencyCode": "AUD",
"taxCode": "G",
"branchNo": 1,
"branchCode": "ACT",
"discountPerc": 0.0,
"priceExcl": 44.37,
"priceIncl": 48.807,
"priceBreaks": [
{
"qtyGreaterOrEqual": 10.0,
"discountPerc": 5.0,
"priceExcl": 42.15,
"priceIncl": 46.365
},
{
"qtyGreaterOrEqual": 50.0,
"discountPerc": 10.0,
"priceExcl": 39.93,
"priceIncl": 43.923
},
{
"qtyGreaterOrEqual": 100.0,
"discountPerc": 15.0,
"priceExcl": 37.71,
"priceIncl": 41.481
}
]
}
}
}